<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="manifest" href="./manifest.json">
  <title>添加到主屏幕</title>
</head>
<body>
  <script>
    if ('serviceWorker' in navigator) {
      navigator.serviceWorker.register('./sw.js')
        .then(function (reg) {
          console.log('Service Worker registration successful at scope:', reg.scope)
        })
        .catch(function (err) {
          console.log('Service Worker registration failed,', err)
        })
    }
  </script>
</body>
</html>